package games;

public class Tower {

    private SquareColor color;
    private Boolean player;
    
    public Tower(SquareColor color, Boolean player) {
        this.color = color;
        this.player = player;
    }

    public SquareColor getColor() {
        return color;
    }

    public Boolean getPlayer() {
        return player;
    }
    

    @Override
    public String toString() {
        return "Tower{" + "color=" + color + ", player=" + player + '}';
    }
    
    @Override
    public int hashCode() {
    	int hash = 100;
    	if(player)
    		hash += 100;
    	
    	return hash+color.hashCode();
    }
    
    public boolean equals(Object o) {
    	if (o instanceof Tower) {
    		Tower tower = (Tower) o;
    		if(this.color == tower.getColor() && this.player == tower.getPlayer())
        		return true;
    	}
    	
    	return false;
    }
    
}
